<template>
	<view class="liuyan_content">
		<view style="width: 690rpx;height: 60rpx;font-size: 29rpx;">
			<view style="font-size: 40rpx;">{{$t('留言内容')}}:</view>
		</view>
		<view style="width: 690rpx;min-height: 250rpx;background-color: #FFFFFF;border-radius: 16rpx;margin-top: 20rpx;border: 1rpx solid #999999;padding: 20rpx;">
			<textarea v-model="value" maxlength="200" :placeholder="$t('请输入您的留言内容(200字以内)')"/>
		</view>
		<view class="submit" @click="handeleSubmit">{{$t('提交')}}</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				value:''
			}
		},
		methods:{
			handeleSubmit(){
				 let data={
					 advice:this.value
				 }
				this.$u.api.order.saveMessage(data).then(res=>{
					uni.showToast({
						title: this.$t('留言成功'),
						icon: 'none',
						duration: 1000
					}) 
					uni.switchTab({
						url: '/pages/tabbar/index'
					})
				})
			}
		},
		onReady() {
			uni.setNavigationBarTitle({
				title: this.$t("留言板")
			})
		},
	}
</script>

<style scoped>
	.submit{
		margin-top: 50rpx;
		width: 690rpx;
		height: 90rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 16rpx;
		background-color: blue;
		color: #FFFFFF;
		font-size: 40rpx;
	}
	.liuyan_content{
		width: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
	}
</style>